package com.bac.rentmap.manager;

import com.bac.rentmap.ad.flat.LocalAddress;
import com.bac.rentmap.model.Building;
import com.google.appengine.api.datastore.GeoPt;

import java.util.List;

/**
 * Saves and load building from datastore.
 *
 * @author Ivan Holub
 */
public interface BuildingManager {
    List<Building> getBuildings(int number);

    void saveBuildings(List<Building> buildings, String city);

    /**
    * Find building by parameters.
    *
    * @param city
    *            required
    * @param localAddress
    *            required
    * @return {@link Building} or null.
    */
    Building findBuilding(String city, LocalAddress localAddress);

    Building findNearestBuilding(String city, GeoPt geoPt);

    void clearBuildings(int number);

    int getBuildingsCount();

    int getMaxNumber(String city);
}
